3.3.22 \(\int \frac {\cot ^4(e+f x)}{a+b \tan ^2(e+f x)} \, dx\) [222]

3.3.22.1 Optimal result
3.3.22.2 Mathematica [A] (verified)
3.3.22.3 Rubi [A] (verified)
3.3.22.4 Maple [A] (verified)
3.3.22.5 Fricas [A] (verification not implemented)
3.3.22.6 Sympy [B] (verification not implemented)
3.3.22.7 Maxima [A] (verification not implemented)
3.3.22.8 Giac [A] (verification not implemented)
3.3.22.9 Mupad [B] (verification not implemented)

3.3.22.1 Optimal result

Integrand size = 23, antiderivative size = 84 \[ \int \frac {\cot ^4(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\frac {x}{a-b}-\frac {b^{5/2} \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{a^{5/2} (a-b) f}+\frac {(a+b) \cot (e+f x)}{a^2 f}-\frac {\cot ^3(e+f x)}{3 a f} \]

output
x/(a-b)-b^(5/2)*arctan(b^(1/2)*tan(f*x+e)/a^(1/2))/a^(5/2)/(a-b)/f+(a+b)*c 
ot(f*x+e)/a^2/f-1/3*cot(f*x+e)^3/a/f
 
3.3.22.2 Mathematica [A] (verified)

Time = 0.75 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.10 \[ \int \frac {\cot ^4(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\frac {-3 b^{5/2} \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )+\sqrt {a} \left (3 a^2 (e+f x)-(a-b) \cot (e+f x) \left (-4 a-3 b+a \csc ^2(e+f x)\right )\right )}{3 a^{5/2} (a-b) f} \]

input
Integrate[Cot[e + f*x]^4/(a + b*Tan[e + f*x]^2),x]
 
output
(-3*b^(5/2)*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a]] + Sqrt[a]*(3*a^2*(e + f 
*x) - (a - b)*Cot[e + f*x]*(-4*a - 3*b + a*Csc[e + f*x]^2)))/(3*a^(5/2)*(a 
 - b)*f)
 
3.3.22.3 Rubi [A] (verified)

Time = 0.33 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.20, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.348, Rules used = {3042, 4153, 382, 27, 445, 397, 216, 218}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\cot ^4(e+f x)}{a+b \tan ^2(e+f x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\tan (e+f x)^4 \left (a+b \tan (e+f x)^2\right )}dx\)

\(\Big \downarrow \) 4153

\(\displaystyle \frac {\int \frac {\cot ^4(e+f x)}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a\right )}d\tan (e+f x)}{f}\)

\(\Big \downarrow \) 382

\(\displaystyle \frac {\frac {\int -\frac {3 \cot ^2(e+f x) \left (b \tan ^2(e+f x)+a+b\right )}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a\right )}d\tan (e+f x)}{3 a}-\frac {\cot ^3(e+f x)}{3 a}}{f}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {-\frac {\int \frac {\cot ^2(e+f x) \left (b \tan ^2(e+f x)+a+b\right )}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a\right )}d\tan (e+f x)}{a}-\frac {\cot ^3(e+f x)}{3 a}}{f}\)

\(\Big \downarrow \) 445

\(\displaystyle \frac {-\frac {-\frac {\int \frac {a^2+b a+b^2+b (a+b) \tan ^2(e+f x)}{\left (\tan ^2(e+f x)+1\right ) \left (b \tan ^2(e+f x)+a\right )}d\tan (e+f x)}{a}-\frac {(a+b) \cot (e+f x)}{a}}{a}-\frac {\cot ^3(e+f x)}{3 a}}{f}\)

\(\Big \downarrow \) 397

\(\displaystyle \frac {-\frac {-\frac {\frac {a^2 \int \frac {1}{\tan ^2(e+f x)+1}d\tan (e+f x)}{a-b}-\frac {b^3 \int \frac {1}{b \tan ^2(e+f x)+a}d\tan (e+f x)}{a-b}}{a}-\frac {(a+b) \cot (e+f x)}{a}}{a}-\frac {\cot ^3(e+f x)}{3 a}}{f}\)

\(\Big \downarrow \) 216

\(\displaystyle \frac {-\frac {-\frac {\frac {a^2 \arctan (\tan (e+f x))}{a-b}-\frac {b^3 \int \frac {1}{b \tan ^2(e+f x)+a}d\tan (e+f x)}{a-b}}{a}-\frac {(a+b) \cot (e+f x)}{a}}{a}-\frac {\cot ^3(e+f x)}{3 a}}{f}\)

\(\Big \downarrow \) 218

\(\displaystyle \frac {-\frac {-\frac {\frac {a^2 \arctan (\tan (e+f x))}{a-b}-\frac {b^{5/2} \arctan \left (\frac {\sqrt {b} \tan (e+f x)}{\sqrt {a}}\right )}{\sqrt {a} (a-b)}}{a}-\frac {(a+b) \cot (e+f x)}{a}}{a}-\frac {\cot ^3(e+f x)}{3 a}}{f}\)

input
Int[Cot[e + f*x]^4/(a + b*Tan[e + f*x]^2),x]
 
output
(-1/3*Cot[e + f*x]^3/a - (-(((a^2*ArcTan[Tan[e + f*x]])/(a - b) - (b^(5/2) 
*ArcTan[(Sqrt[b]*Tan[e + f*x])/Sqrt[a]])/(Sqrt[a]*(a - b)))/a) - ((a + b)* 
Cot[e + f*x])/a)/a)/f
 

3.3.22.3.1 Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

rule 218
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R 
t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
 

rule 382
Int[((e_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_) 
, x_Symbol] :> Simp[(e*x)^(m + 1)*(a + b*x^2)^(p + 1)*((c + d*x^2)^(q + 1)/ 
(a*c*e*(m + 1))), x] - Simp[1/(a*c*e^2*(m + 1))   Int[(e*x)^(m + 2)*(a + b* 
x^2)^p*(c + d*x^2)^q*Simp[(b*c + a*d)*(m + 3) + 2*(b*c*p + a*d*q) + b*d*(m 
+ 2*p + 2*q + 5)*x^2, x], x], x] /; FreeQ[{a, b, c, d, e, p, q}, x] && NeQ[ 
b*c - a*d, 0] && LtQ[m, -1] && IntBinomialQ[a, b, c, d, e, m, 2, p, q, x]
 

rule 397
Int[((e_) + (f_.)*(x_)^2)/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_ 
Symbol] :> Simp[(b*e - a*f)/(b*c - a*d)   Int[1/(a + b*x^2), x], x] - Simp[ 
(d*e - c*f)/(b*c - a*d)   Int[1/(c + d*x^2), x], x] /; FreeQ[{a, b, c, d, e 
, f}, x]
 

rule 445
Int[((g_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q_ 
.)*((e_) + (f_.)*(x_)^2), x_Symbol] :> Simp[e*(g*x)^(m + 1)*(a + b*x^2)^(p 
+ 1)*((c + d*x^2)^(q + 1)/(a*c*g*(m + 1))), x] + Simp[1/(a*c*g^2*(m + 1)) 
 Int[(g*x)^(m + 2)*(a + b*x^2)^p*(c + d*x^2)^q*Simp[a*f*c*(m + 1) - e*(b*c 
+ a*d)*(m + 2 + 1) - e*2*(b*c*p + a*d*q) - b*e*d*(m + 2*(p + q + 2) + 1)*x^ 
2, x], x], x] /; FreeQ[{a, b, c, d, e, f, g, p, q}, x] && LtQ[m, -1]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4153
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + 
(f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], 
 x]}, Simp[c*(ff/f)   Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f 
f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, 
n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio 
nalQ[n]))
 
3.3.22.4 Maple [A] (verified)

Time = 0.19 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.05

method result size
derivativedivides \(\frac {-\frac {1}{3 a \tan \left (f x +e \right )^{3}}-\frac {-a -b}{a^{2} \tan \left (f x +e \right )}-\frac {b^{3} \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{a^{2} \left (a -b \right ) \sqrt {a b}}+\frac {\arctan \left (\tan \left (f x +e \right )\right )}{a -b}}{f}\) \(88\)
default \(\frac {-\frac {1}{3 a \tan \left (f x +e \right )^{3}}-\frac {-a -b}{a^{2} \tan \left (f x +e \right )}-\frac {b^{3} \arctan \left (\frac {b \tan \left (f x +e \right )}{\sqrt {a b}}\right )}{a^{2} \left (a -b \right ) \sqrt {a b}}+\frac {\arctan \left (\tan \left (f x +e \right )\right )}{a -b}}{f}\) \(88\)
risch \(\frac {x}{a -b}+\frac {2 i \left (6 a \,{\mathrm e}^{4 i \left (f x +e \right )}+3 b \,{\mathrm e}^{4 i \left (f x +e \right )}-6 a \,{\mathrm e}^{2 i \left (f x +e \right )}-6 b \,{\mathrm e}^{2 i \left (f x +e \right )}+4 a +3 b \right )}{3 f \,a^{2} \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )^{3}}+\frac {\sqrt {-a b}\, b^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+\frac {2 i \sqrt {-a b}+a +b}{a -b}\right )}{2 a^{3} \left (a -b \right ) f}-\frac {\sqrt {-a b}\, b^{2} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {2 i \sqrt {-a b}-a -b}{a -b}\right )}{2 a^{3} \left (a -b \right ) f}\) \(203\)

input
int(cot(f*x+e)^4/(a+b*tan(f*x+e)^2),x,method=_RETURNVERBOSE)
 
output
1/f*(-1/3/a/tan(f*x+e)^3-(-a-b)/a^2/tan(f*x+e)-1/a^2*b^3/(a-b)/(a*b)^(1/2) 
*arctan(b*tan(f*x+e)/(a*b)^(1/2))+1/(a-b)*arctan(tan(f*x+e)))
 
3.3.22.5 Fricas [A] (verification not implemented)

Time = 0.31 (sec) , antiderivative size = 308, normalized size of antiderivative = 3.67 \[ \int \frac {\cot ^4(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\left [\frac {12 \, a^{2} f x \tan \left (f x + e\right )^{3} - 3 \, b^{2} \sqrt {-\frac {b}{a}} \log \left (\frac {b^{2} \tan \left (f x + e\right )^{4} - 6 \, a b \tan \left (f x + e\right )^{2} + a^{2} + 4 \, {\left (a b \tan \left (f x + e\right )^{3} - a^{2} \tan \left (f x + e\right )\right )} \sqrt {-\frac {b}{a}}}{b^{2} \tan \left (f x + e\right )^{4} + 2 \, a b \tan \left (f x + e\right )^{2} + a^{2}}\right ) \tan \left (f x + e\right )^{3} + 12 \, {\left (a^{2} - b^{2}\right )} \tan \left (f x + e\right )^{2} - 4 \, a^{2} + 4 \, a b}{12 \, {\left (a^{3} - a^{2} b\right )} f \tan \left (f x + e\right )^{3}}, \frac {6 \, a^{2} f x \tan \left (f x + e\right )^{3} - 3 \, b^{2} \sqrt {\frac {b}{a}} \arctan \left (\frac {{\left (b \tan \left (f x + e\right )^{2} - a\right )} \sqrt {\frac {b}{a}}}{2 \, b \tan \left (f x + e\right )}\right ) \tan \left (f x + e\right )^{3} + 6 \, {\left (a^{2} - b^{2}\right )} \tan \left (f x + e\right )^{2} - 2 \, a^{2} + 2 \, a b}{6 \, {\left (a^{3} - a^{2} b\right )} f \tan \left (f x + e\right )^{3}}\right ] \]

input
integrate(cot(f*x+e)^4/(a+b*tan(f*x+e)^2),x, algorithm="fricas")
 
output
[1/12*(12*a^2*f*x*tan(f*x + e)^3 - 3*b^2*sqrt(-b/a)*log((b^2*tan(f*x + e)^ 
4 - 6*a*b*tan(f*x + e)^2 + a^2 + 4*(a*b*tan(f*x + e)^3 - a^2*tan(f*x + e)) 
*sqrt(-b/a))/(b^2*tan(f*x + e)^4 + 2*a*b*tan(f*x + e)^2 + a^2))*tan(f*x + 
e)^3 + 12*(a^2 - b^2)*tan(f*x + e)^2 - 4*a^2 + 4*a*b)/((a^3 - a^2*b)*f*tan 
(f*x + e)^3), 1/6*(6*a^2*f*x*tan(f*x + e)^3 - 3*b^2*sqrt(b/a)*arctan(1/2*( 
b*tan(f*x + e)^2 - a)*sqrt(b/a)/(b*tan(f*x + e)))*tan(f*x + e)^3 + 6*(a^2 
- b^2)*tan(f*x + e)^2 - 2*a^2 + 2*a*b)/((a^3 - a^2*b)*f*tan(f*x + e)^3)]
 
3.3.22.6 Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 775 vs. \(2 (66) = 132\).

Time = 28.68 (sec) , antiderivative size = 775, normalized size of antiderivative = 9.23 \[ \int \frac {\cot ^4(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\begin {cases} \tilde {\infty } x & \text {for}\: a = 0 \wedge b = 0 \wedge e = 0 \wedge f = 0 \\\frac {x - \frac {\cot ^{3}{\left (e + f x \right )}}{3 f} + \frac {\cot {\left (e + f x \right )}}{f}}{a} & \text {for}\: b = 0 \\\frac {- x - \frac {1}{f \tan {\left (e + f x \right )}} + \frac {1}{3 f \tan ^{3}{\left (e + f x \right )}} - \frac {1}{5 f \tan ^{5}{\left (e + f x \right )}}}{b} & \text {for}\: a = 0 \\\frac {15 f x \tan ^{5}{\left (e + f x \right )}}{6 b f \tan ^{5}{\left (e + f x \right )} + 6 b f \tan ^{3}{\left (e + f x \right )}} + \frac {15 f x \tan ^{3}{\left (e + f x \right )}}{6 b f \tan ^{5}{\left (e + f x \right )} + 6 b f \tan ^{3}{\left (e + f x \right )}} + \frac {15 \tan ^{4}{\left (e + f x \right )}}{6 b f \tan ^{5}{\left (e + f x \right )} + 6 b f \tan ^{3}{\left (e + f x \right )}} + \frac {10 \tan ^{2}{\left (e + f x \right )}}{6 b f \tan ^{5}{\left (e + f x \right )} + 6 b f \tan ^{3}{\left (e + f x \right )}} - \frac {2}{6 b f \tan ^{5}{\left (e + f x \right )} + 6 b f \tan ^{3}{\left (e + f x \right )}} & \text {for}\: a = b \\\frac {\tilde {\infty } x}{a} & \text {for}\: e = - f x \\\frac {x \cot ^{4}{\left (e \right )}}{a + b \tan ^{2}{\left (e \right )}} & \text {for}\: f = 0 \\\frac {6 a^{2} f x \sqrt {- \frac {a}{b}} \tan ^{3}{\left (e + f x \right )}}{6 a^{3} f \sqrt {- \frac {a}{b}} \tan ^{3}{\left (e + f x \right )} - 6 a^{2} b f \sqrt {- \frac {a}{b}} \tan ^{3}{\left (e + f x \right )}} + \frac {6 a^{2} \sqrt {- \frac {a}{b}} \tan ^{2}{\left (e + f x \right )}}{6 a^{3} f \sqrt {- \frac {a}{b}} \tan ^{3}{\left (e + f x \right )} - 6 a^{2} b f \sqrt {- \frac {a}{b}} \tan ^{3}{\left (e + f x \right )}} - \frac {2 a^{2} \sqrt {- \frac {a}{b}}}{6 a^{3} f \sqrt {- \frac {a}{b}} \tan ^{3}{\left (e + f x \right )} - 6 a^{2} b f \sqrt {- \frac {a}{b}} \tan ^{3}{\left (e + f x \right )}} + \frac {2 a b \sqrt {- \frac {a}{b}}}{6 a^{3} f \sqrt {- \frac {a}{b}} \tan ^{3}{\left (e + f x \right )} - 6 a^{2} b f \sqrt {- \frac {a}{b}} \tan ^{3}{\left (e + f x \right )}} - \frac {6 b^{2} \sqrt {- \frac {a}{b}} \tan ^{2}{\left (e + f x \right )}}{6 a^{3} f \sqrt {- \frac {a}{b}} \tan ^{3}{\left (e + f x \right )} - 6 a^{2} b f \sqrt {- \frac {a}{b}} \tan ^{3}{\left (e + f x \right )}} - \frac {3 b^{2} \log {\left (- \sqrt {- \frac {a}{b}} + \tan {\left (e + f x \right )} \right )} \tan ^{3}{\left (e + f x \right )}}{6 a^{3} f \sqrt {- \frac {a}{b}} \tan ^{3}{\left (e + f x \right )} - 6 a^{2} b f \sqrt {- \frac {a}{b}} \tan ^{3}{\left (e + f x \right )}} + \frac {3 b^{2} \log {\left (\sqrt {- \frac {a}{b}} + \tan {\left (e + f x \right )} \right )} \tan ^{3}{\left (e + f x \right )}}{6 a^{3} f \sqrt {- \frac {a}{b}} \tan ^{3}{\left (e + f x \right )} - 6 a^{2} b f \sqrt {- \frac {a}{b}} \tan ^{3}{\left (e + f x \right )}} & \text {otherwise} \end {cases} \]

input
integrate(cot(f*x+e)**4/(a+b*tan(f*x+e)**2),x)
 
output
Piecewise((zoo*x, Eq(a, 0) & Eq(b, 0) & Eq(e, 0) & Eq(f, 0)), ((x - cot(e 
+ f*x)**3/(3*f) + cot(e + f*x)/f)/a, Eq(b, 0)), ((-x - 1/(f*tan(e + f*x)) 
+ 1/(3*f*tan(e + f*x)**3) - 1/(5*f*tan(e + f*x)**5))/b, Eq(a, 0)), (15*f*x 
*tan(e + f*x)**5/(6*b*f*tan(e + f*x)**5 + 6*b*f*tan(e + f*x)**3) + 15*f*x* 
tan(e + f*x)**3/(6*b*f*tan(e + f*x)**5 + 6*b*f*tan(e + f*x)**3) + 15*tan(e 
 + f*x)**4/(6*b*f*tan(e + f*x)**5 + 6*b*f*tan(e + f*x)**3) + 10*tan(e + f* 
x)**2/(6*b*f*tan(e + f*x)**5 + 6*b*f*tan(e + f*x)**3) - 2/(6*b*f*tan(e + f 
*x)**5 + 6*b*f*tan(e + f*x)**3), Eq(a, b)), (zoo*x/a, Eq(e, -f*x)), (x*cot 
(e)**4/(a + b*tan(e)**2), Eq(f, 0)), (6*a**2*f*x*sqrt(-a/b)*tan(e + f*x)** 
3/(6*a**3*f*sqrt(-a/b)*tan(e + f*x)**3 - 6*a**2*b*f*sqrt(-a/b)*tan(e + f*x 
)**3) + 6*a**2*sqrt(-a/b)*tan(e + f*x)**2/(6*a**3*f*sqrt(-a/b)*tan(e + f*x 
)**3 - 6*a**2*b*f*sqrt(-a/b)*tan(e + f*x)**3) - 2*a**2*sqrt(-a/b)/(6*a**3* 
f*sqrt(-a/b)*tan(e + f*x)**3 - 6*a**2*b*f*sqrt(-a/b)*tan(e + f*x)**3) + 2* 
a*b*sqrt(-a/b)/(6*a**3*f*sqrt(-a/b)*tan(e + f*x)**3 - 6*a**2*b*f*sqrt(-a/b 
)*tan(e + f*x)**3) - 6*b**2*sqrt(-a/b)*tan(e + f*x)**2/(6*a**3*f*sqrt(-a/b 
)*tan(e + f*x)**3 - 6*a**2*b*f*sqrt(-a/b)*tan(e + f*x)**3) - 3*b**2*log(-s 
qrt(-a/b) + tan(e + f*x))*tan(e + f*x)**3/(6*a**3*f*sqrt(-a/b)*tan(e + f*x 
)**3 - 6*a**2*b*f*sqrt(-a/b)*tan(e + f*x)**3) + 3*b**2*log(sqrt(-a/b) + ta 
n(e + f*x))*tan(e + f*x)**3/(6*a**3*f*sqrt(-a/b)*tan(e + f*x)**3 - 6*a**2* 
b*f*sqrt(-a/b)*tan(e + f*x)**3), True))
 
3.3.22.7 Maxima [A] (verification not implemented)

Time = 0.32 (sec) , antiderivative size = 86, normalized size of antiderivative = 1.02 \[ \int \frac {\cot ^4(e+f x)}{a+b \tan ^2(e+f x)} \, dx=-\frac {\frac {3 \, b^{3} \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )}{{\left (a^{3} - a^{2} b\right )} \sqrt {a b}} - \frac {3 \, {\left (f x + e\right )}}{a - b} - \frac {3 \, {\left (a + b\right )} \tan \left (f x + e\right )^{2} - a}{a^{2} \tan \left (f x + e\right )^{3}}}{3 \, f} \]

input
integrate(cot(f*x+e)^4/(a+b*tan(f*x+e)^2),x, algorithm="maxima")
 
output
-1/3*(3*b^3*arctan(b*tan(f*x + e)/sqrt(a*b))/((a^3 - a^2*b)*sqrt(a*b)) - 3 
*(f*x + e)/(a - b) - (3*(a + b)*tan(f*x + e)^2 - a)/(a^2*tan(f*x + e)^3))/ 
f
 
3.3.22.8 Giac [A] (verification not implemented)

Time = 0.85 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.33 \[ \int \frac {\cot ^4(e+f x)}{a+b \tan ^2(e+f x)} \, dx=-\frac {\frac {3 \, {\left (\pi \left \lfloor \frac {f x + e}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (b\right ) + \arctan \left (\frac {b \tan \left (f x + e\right )}{\sqrt {a b}}\right )\right )} b^{3}}{{\left (a^{3} - a^{2} b\right )} \sqrt {a b}} - \frac {3 \, {\left (f x + e\right )}}{a - b} - \frac {3 \, a \tan \left (f x + e\right )^{2} + 3 \, b \tan \left (f x + e\right )^{2} - a}{a^{2} \tan \left (f x + e\right )^{3}}}{3 \, f} \]

input
integrate(cot(f*x+e)^4/(a+b*tan(f*x+e)^2),x, algorithm="giac")
 
output
-1/3*(3*(pi*floor((f*x + e)/pi + 1/2)*sgn(b) + arctan(b*tan(f*x + e)/sqrt( 
a*b)))*b^3/((a^3 - a^2*b)*sqrt(a*b)) - 3*(f*x + e)/(a - b) - (3*a*tan(f*x 
+ e)^2 + 3*b*tan(f*x + e)^2 - a)/(a^2*tan(f*x + e)^3))/f
 
3.3.22.9 Mupad [B] (verification not implemented)

Time = 11.23 (sec) , antiderivative size = 484, normalized size of antiderivative = 5.76 \[ \int \frac {\cot ^4(e+f x)}{a+b \tan ^2(e+f x)} \, dx=\frac {a^4\,b+{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (3\,a^5-3\,a^3\,b^2\right )-a^5}{f\,\left (3\,a^6\,{\mathrm {tan}\left (e+f\,x\right )}^3-3\,a^5\,b\,{\mathrm {tan}\left (e+f\,x\right )}^3\right )}-\frac {\mathrm {atan}\left (\frac {a^{10}\,b\,\mathrm {tan}\left (e+f\,x\right )\,\sqrt {-a^5\,b^5}\,1{}\mathrm {i}-a^5\,b^6\,\mathrm {tan}\left (e+f\,x\right )\,\sqrt {-a^5\,b^5}\,1{}\mathrm {i}}{a^8\,b^8-a^{13}\,b^3}\right )\,\sqrt {-a^5\,b^5}\,3{}\mathrm {i}-3\,a^5\,\mathrm {atan}\left (\frac {\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (2\,a^{10}\,b^3+2\,a^6\,b^7\right )+\frac {\left (4\,a^9\,b^5-4\,a^8\,b^6+4\,a^{11}\,b^3-4\,a^{12}\,b^2+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (8\,a^{13}\,b^2-8\,a^{12}\,b^3-8\,a^{11}\,b^4+8\,a^{10}\,b^5\right )\,1{}\mathrm {i}}{2\,a-2\,b}\right )\,1{}\mathrm {i}}{2\,a-2\,b}}{2\,a-2\,b}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (2\,a^{10}\,b^3+2\,a^6\,b^7\right )+\frac {\left (4\,a^8\,b^6-4\,a^9\,b^5-4\,a^{11}\,b^3+4\,a^{12}\,b^2+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (8\,a^{13}\,b^2-8\,a^{12}\,b^3-8\,a^{11}\,b^4+8\,a^{10}\,b^5\right )\,1{}\mathrm {i}}{2\,a-2\,b}\right )\,1{}\mathrm {i}}{2\,a-2\,b}}{2\,a-2\,b}}{2\,a^{10}\,b^2+2\,a^9\,b^3+2\,a^8\,b^4+2\,a^7\,b^5+2\,a^6\,b^6}\right )}{f\,\left (3\,a^5\,b-3\,a^6\right )} \]

input
int(cot(e + f*x)^4/(a + b*tan(e + f*x)^2),x)
 
output
(a^4*b + tan(e + f*x)^2*(3*a^5 - 3*a^3*b^2) - a^5)/(f*(3*a^6*tan(e + f*x)^ 
3 - 3*a^5*b*tan(e + f*x)^3)) - (atan((a^10*b*tan(e + f*x)*(-a^5*b^5)^(1/2) 
*1i - a^5*b^6*tan(e + f*x)*(-a^5*b^5)^(1/2)*1i)/(a^8*b^8 - a^13*b^3))*(-a^ 
5*b^5)^(1/2)*3i - 3*a^5*atan(((((4*a^9*b^5 - 4*a^8*b^6 + 4*a^11*b^3 - 4*a^ 
12*b^2 + (tan(e + f*x)*(8*a^10*b^5 - 8*a^11*b^4 - 8*a^12*b^3 + 8*a^13*b^2) 
*1i)/(2*a - 2*b))*1i)/(2*a - 2*b) + tan(e + f*x)*(2*a^6*b^7 + 2*a^10*b^3)) 
/(2*a - 2*b) + (((4*a^8*b^6 - 4*a^9*b^5 - 4*a^11*b^3 + 4*a^12*b^2 + (tan(e 
 + f*x)*(8*a^10*b^5 - 8*a^11*b^4 - 8*a^12*b^3 + 8*a^13*b^2)*1i)/(2*a - 2*b 
))*1i)/(2*a - 2*b) + tan(e + f*x)*(2*a^6*b^7 + 2*a^10*b^3))/(2*a - 2*b))/( 
2*a^6*b^6 + 2*a^7*b^5 + 2*a^8*b^4 + 2*a^9*b^3 + 2*a^10*b^2)))/(f*(3*a^5*b 
- 3*a^6))